//
//  logging.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2013-2014 Razvan Coca (razvan dot coca at  gmail dot com)
// This is mostly generated code. Generator is distributed under GPL. Edit it to suit your needs.
// 



#include <sys/stat.h>
#include <sys/types.h>
#include "logging.hpp"

int init_log(const char* module,std::string log_path)
{
    FLAGS_alsologtostderr=1;
    if(log_path.size())
        FLAGS_log_dir=log_path;
    else
        FLAGS_log_dir="logs";
    mkdir(FLAGS_log_dir.c_str(),0700);
    google::InitGoogleLogging(module);
    google::InstallFailureSignalHandler();    
    return true;
}
